/**
 */
package fUML.Semantics.Actions.IntermediateActions;

import fUML.Semantics.Actions.BasicActions.ActionActivation;

import fUML.Semantics.Classes.Kernel.Link;
import fUML.Semantics.Classes.Kernel.Reference;
import fUML.Semantics.Classes.Kernel.Value;

/**
 * <!-- begin-user-doc -->
 * A representation of the model object '<em><b>Destroy Object Action Activation</b></em>'.
 * <!-- end-user-doc -->
 *
 * <!-- begin-model-doc -->
 * A destroy object action activation is an action activation for a destroy object
 *                 action.
 * <!-- end-model-doc -->
 *
 *
 * @see fUML.Semantics.Actions.IntermediateActions.IntermediateActionsPackage#getDestroyObjectActionActivation()
 * @model
 * @generated
 */
public interface DestroyObjectActionActivation extends ActionActivation {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * // If the given value is a reference, then destroy the referenced object, per
	 *                   the given destroy action attribute values.
	 *  
	 *  //
	 *                   Debug.println("[destroyObject] object = " + value.objectId());
	 *  
	 *                   if (value instanceof Reference) {
	 *  Reference reference =
	 *                   (Reference)value;
	 *  
	 *  if (isDestroyLinks | isDestroyOwnedObjects)
	 *                   {
	 *  Debug.println("[destroyObject] Destroying links...");
	 *                   ExtensionalValueList extensionalValues =
	 *                   this.getExecutionLocus().extensionalValues;
	 *  for (int i = 0; i <
	 *                   extensionalValues.size(); i++) {
	 *  ExtensionalValue extensionalValue =
	 *                   extensionalValues.getValue(i);
	 *  if (extensionalValue instanceof Link)
	 *                   {
	 *  Link link = (Link)extensionalValue;
	 *  if
	 *                   (this.valueParticipatesInLink(reference, link)) {
	 *  if (isDestroyLinks |
	 *                   this.objectIsComposite(reference, link)) {
	 *  //
	 *                   Debug.println("[destroyObject] Destroying link " + link.objectId());
	 *                   link.destroy();
	 *  }
	 *  }
	 *  }
	 *  }
	 *  }
	 *                   
	 *  if (isDestroyOwnedObjects) {
	 *  Debug.println("[destroyObject]
	 *                   Destroying owned objects...");
	 *  FeatureValueList objectFeatureValues =
	 *                   reference.getFeatureValues();
	 *  for (int i = 0; i <
	 *                   objectFeatureValues.size(); i++) {
	 *  FeatureValue featureValue =
	 *                   objectFeatureValues.getValue(i);
	 *  if
	 *                   (((Property)featureValue.feature).aggregation == AggregationKind.composite)
	 *                   {
	 *  ValueList values = featureValue.values;
	 *  for (int j = 0; j
	 *                   < values.size(); j++) {
	 *  Value ownedValue =
	 *                   values.getValue(j);
	 *  this.destroyObject(ownedValue, isDestroyLinks,
	 *                   isDestroyOwnedObjects);
	 *  }
	 *  }
	 *  }
	 *  }
	 *                   
	 *  reference.destroy();
	 *  }
	 *  
	 * <!-- end-model-doc -->
	 * @model valueRequired="true" valueOrdered="false" isDestroyLinksRequired="true" isDestroyLinksOrdered="false" isDestroyOwnedObjectsRequired="true" isDestroyOwnedObjectsOrdered="false"
	 * @generated
	 */
	void destroyObject(Value value, boolean isDestroyLinks, boolean isDestroyOwnedObjects);

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * <!-- begin-model-doc -->
	 * // Test whether the given reference participates in the given link as a
	 *                   composite.
	 *  
	 *  FeatureValueList linkFeatureValues =
	 *                   link.getFeatureValues();
	 *  
	 *  boolean isComposite = false;
	 *                   int i = 1;
	 *  while (!isComposite & i <=
	 *                   linkFeatureValues.size()) {
	 *  FeatureValue featureValue =
	 *                   linkFeatureValues.getValue(i-1);
	 *  if
	 *                   (!featureValue.values.getValue(0).equals(reference) &
	 *                   ((Property)featureValue.feature).aggregation == AggregationKind.composite)
	 *                   {
	 *  isComposite = true;
	 *  }
	 *  }
	 *  
	 *  return
	 *                   isComposite;
	 *  
	 *  
	 * <!-- end-model-doc -->
	 * @model required="true" ordered="false" referenceRequired="true" referenceOrdered="false" linkRequired="true" linkOrdered="false"
	 * @generated
	 */
	boolean objectIsComposite(Reference reference, Link link);

} // DestroyObjectActionActivation
